<?php
    class AppSessionHandler extends SessionHandler {           
        public function read($id) {
            $data = parent::read($id);
            
            return mcrypt_decrypt(MCRYPT_3DES,config("session","cryptkey"),$data,MCRYPT_MODE_ECB);
        }
           
        public function write($id,$data) {
            $data = mcrypt_encrypt(MCRYPT_3DES,config("session","cryptkey"),$data,MCRYPT_MODE_ECB);
            
            return parent::write($id,$data);
        }
    }